<?php
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return 
	array(
	'basePath'=>dirname(__FILE__).DS.'..',
	'name'=>'Administrator Panel',
	'theme'=>'default',
	'defaultController'=>'dashboard',
	// preloading 'log' component
	'preload'=>array(
			'bootstrap',
			'log'
			),
	// autoloading model and component classes
	'import'=>array(
		'common.models.db.*',
		'common.models.db._base.*',
		'application.models.*',
		'application.components.*',
		'application.helpers.*',
		'application.modules.user.models.*',
		'application.modules.user.components.*',
		'application.modules.srbac.controllers.SBaseController',
		'application.extensions.jtogglecolumn.*',
		'ext.giix-components.*', // giix components
		'ext.uploadify.*',
		'ext.elrte.*',
	),
	'aliases' => array(
			//assuming you extracted the files to the extensions folder
			'xupload' => 'ext.xupload'
	),
	'behaviors' => array('BackendConfigBehavior'),
	'modules'=>array(
		'dashboard',
		'news',
		'dev',
		'media',
		'polls',
		'banners',
		'gallery',
		'comment',
		'menu',
		'widget',
		'translate',
		'infosys',
		'shop' => array( 'debug' => 'true'),
		'sys',
		'user'=> array(
				# encrypting method (php hash function)
				'hash' => 'md5',
				
				# send activation email
				'sendActivationMail' => true,
				
				# allow access for non-activated users
				'loginNotActiv' => false,
		
				# activate user on registration (only sendActivationMail = false)
				'activeAfterRegister' => false,
		
				# automatically login from registration
				'autoLogin' => true,

				# registration path
				'registrationUrl' => array('/user/registration'),

				# recovery password path
				'recoveryUrl' => array('/user/recovery'),

				# login form path
				'loginUrl' => array('/user/login'),
				
				# page after login
				'returnUrl' => array('/user/profile'),
				
				# page after logout
				'returnLogoutUrl' => array('/user/login'),
				),
			'srbac' => array(
					'userclass'=>'User', //default: User
					'userid'=>'id', //default: userid
					'username'=>'username', //default:username
					'delimeter'=>'@', //default:-
					'debug'=>false, //default :false
					'pageSize'=>10, // default : 15
					'superUser' =>'Administrator', //default: Authorizer
					'css'=>'srbac.css', //default: srbac.css
					'layout'=>
					'application.views.layouts.main', //default: application.views.layouts.main,
					//must be an existing alias
					'notAuthorizedView'=> 'srbac.views.authitem.unauthorized', // default:
					//srbac.views.authitem.unauthorized, must be an existing alias
					'alwaysAllowed'=>array(
					//default: array()
							'UserLogin','SiteLogout','SiteIndex','SiteAdmin',
							'SiteError', 'SiteContact'),
					'userActions'=>array('Show','View','List'), //default: array()
					'listBoxNumberOfLines' => 15, //default : 10
					'imagesPath' => 'srbac.images', // default: srbac.images
					'imagesPack'=>'noia', //default: noia
					'iconText'=>true, // default : false
					'header'=>'srbac.views.authitem.header', //default : srbac.views.authitem.header,
					//must be an existing alias
					'footer'=>'srbac.views.authitem.footer', //default: srbac.views.authitem.footer,
					//must be an existing alias
					'showHeader'=>true, // default: false
					'showFooter'=>true, // default: false
					'alwaysAllowedPath'=>'srbac.components', // default: srbac.components
					// must be an existing alias
			),
				
		'gii' => array(
				'class' => 'system.gii.GiiModule',
				'password'=>'111',
				'ipFilters'=>array('127.0.0.1','::1'),
				'generatorPaths' => array(
						'ext.giix-core', // giix generators
				),
		),
	),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		'image'=>array(
				'class'=>'ext.image.CImageComponent',
				// GD or ImageMagick
				'driver'=>'GD',
				// ImageMagick setup path
				'params'=>array('directory'=>'/opt/local/bin'),
		),
		'bootstrap'=>array(
				'class'=>'ext.bootstrap.components.Bootstrap', // assuming you extracted bootstrap under extensions
		),
		// uncomment the following to enable URLs in path-format
		/*
		'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),
		*/
		'user'=>array(
				// enable cookie-based authentication
				'class' => 'WebUser',
				'allowAutoLogin'=>true,
				'loginUrl' => array('/user/login'),
		),
		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'backend/error',
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning, trace',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
		'authManager'=>array(
				// Path to SDbAuthManager in srbac module if you want to use case insensitive
				//access checking (or CDbAuthManager for case sensitive access checking)
				'class'=>'application.modules.srbac.components.SDbAuthManager',
				// The database component used
				'connectionID'=>'db',
				// The itemTable name (default:authitem)
				'itemTable'=>'items',
				// The assignmentTable name (default:authassignment)
				'assignmentTable'=>'assignments',
				// The itemChildTable name (default:authitemchild)
				'itemChildTable'=>'itemchildren',
		),
	),
	'params'=> array(
			'language_default'=>'vi',
			'languages'	=>	array(
					'vi'	=>	'Vietnamese',
					'en'	=>	'English',
			),
			'multilang'=>true,
			'widgets'	=>	array(
					array('class'=>'customHtml', 'title'=>'Custom Html', 'path'=>'frontend.widgets.CustomHtml.customHtml'),
					array('class'=>'Menu', 'title'=>'Menu', 'path'=>'frontend.widgets.Menu.Menu'),
			),
	)
);